<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // 1.迭代器方法  keys() values() entries()
    const arr = ['a','b','c']
    console.log(arr.keys()) // 一个迭代器对象
    console.log(Array.from(arr.keys())) // [0,1,2]
    console.log(Array.from(arr.values())) // [a,b,c]
    console.log(Array.from(arr.entries())) // [[0,a],[1,b],[2,c] ]

    for(const [key,value] of arr.entries()){
        console.log(key,value)
    }
</script>
</body>
</html>